# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def version
    "Experemental v.#{APP_VERSION} rev.#{APP_REVISION}"
  end
  
  def restrict_to_owner(object, roles = nil, &block)
    allowed = roles.nil? ? current_user.owns?(object) : current_user.owns?(object, roles)
    yield block if allowed
  end
end
